package org.linlinjava.litemall.db.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.ArrayTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.linlinjava.litemall.db.dto.LitemallUpdateDto;
import org.linlinjava.litemall.db.handler.ArrayObjectJsonTypeHandler;
import org.linlinjava.litemall.db.handler.IntegerArrayJsonTypeHandler;
import org.linlinjava.litemall.db.handler.StringArrayJsonTypeHandler;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "litemall_pos_ad",autoResultMap = true)
public class LitemallPosAd implements Serializable {

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId
    private Long id;

    @TableField(value = "shop_ids",jdbcType = JdbcType.VARCHAR,typeHandler = IntegerArrayJsonTypeHandler.class)
    private Integer[] shopIds;

    private Integer type;
    @TableField(value = "img_obj",jdbcType = JdbcType.VARCHAR,typeHandler = IntegerArrayJsonTypeHandler.class)
    private Integer[] imgObj;

    private String imgTitle;

    private Integer uploaderId;

    private String uploaderName;

    private String remark;


    private LocalDateTime startTime;


    private LocalDateTime endTime;

    private Integer isOpen;


    private LocalDateTime addTime;


    private LocalDateTime updateTime;

    @TableLogic
    private Integer deleted;


}
